/*
 * @lc app=leetcode.cn id=342 lang=rust
 *
 * [342] 4的幂
 */

// @lc code=start
impl Solution {
    pub fn is_power_of_four(n: i32) -> bool {
        let dishu = 4;
        let mut n = n;
        while n >= dishu{
            if n % dishu != 0 { return false; }
            n /= dishu;
        }
        // n < dishu
        if n != 1 { return false; }
        return true;    
    }
}
// @lc code=end

